package com.example.stream;

import org.junit.jupiter.api.Test;
import java.util.Arrays;


/**
 * forEach：种植流操作，遍历输出
 */
public class TestForEach {

    String[] persons = new String[]{
            "政府办","区委办","政协","人大"
    };


    @Test
    public void testArray(){
        Arrays.stream(persons).forEach(System.out::println);
    }

    @Test
    public void testList(){
        Arrays.asList(persons).stream().forEach(System.out::println);
    }

}
